package com.code.soulqlexpress.func;

import com.ql.util.express.Operator;

/**
 * @author songyang
 * @date 2022/4/21
 */
public class GeOperator extends Operator {
    @Override
    public Object executeInner(Object[] list) throws Exception {
        String msg;

        if (list[0] == null || list[1] == null) {
            return Boolean.FALSE;
        } else if (!(list[0] instanceof Number) || !(list[1] instanceof Number)) {
            msg = "对象类型不匹配，只有数字类型才才能执行 >= 操作,当前数据类型是:";
            throw new Exception(msg + list[0].getClass().getName() + "," + list[1].getClass().getName());
        } else {
            double obj1 = Double.parseDouble(String.valueOf(list[0]));
            double obj2 = Double.parseDouble(String.valueOf(list[1]));
            return obj1 >= obj2;
        }
    }

}
